<script type="text/javascript">
$(document).ready(function(){

	$("#closeaddCategory").click(function(event){
		event.preventDefault();
		$("#formcategory").hide('blind', function(){
			  $("#formcategory").remove();			  
	    });
	});

	var profileOptions = {
       dataType: "json",    
       success: function(data) { 
            if (data.error == false) { 
                $("#closeaddCategory").click();
                jQuery.facebox("<?= $this->translate('okMsg') ?>");
                $("#feedcategory").trigger("updateCategories");
                $("#category").trigger("updateCategories");
            } else {
                jQuery.facebox(parseJsonValidation(data.messages));
            } 
        },
       error:  function (xhr, ajaxOptions, thrownError) {
            jQuery.facebox("<?= $this->translate('ajaxError') ?>");
       }
    };

    $('#formcategory').ajaxForm(profileOptions);
});
</script>

<form id="<?= $this->escape($this->formAddCategory->getAttrib("id"))?>"
      class="<?= $this->escape($this->formAddCategory->getAttrib("class"))?>" 
      action="<?= $this->escape($this->formAddCategory->getAction())?>" 
      method="<?= $this->escape($this->formAddCategory->getMethod())?>">
      <ul>
          <li>
            <p id="closeaddCategory" class="closebox" title="<?= $this->translate('tipClose')?>">x</p>
          </li>  
          <li id="mod" class="element-group">
            <?= $this->formAddCategory->name ?>
            <span class="hint"><?= $this->translate('msgNameCategory')?></span>      
          </li>
          <li id="mod" class="element-group">
            <?= $this->formAddCategory->description ?>
            <span class="hint"><?= $this->translate('msgDescriptionCategory')?></span>   
          </li>
          <li id="mod" class="element-group">
            <?= $this->formAddCategory->save ?>    
          </li>
      </ul>
</form>      